Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Setup Rewrite #197

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

TheTedder
Copy link
Contributor

@TheTedder TheTedder commented Oct 11, 2023

This PR completely changes the way the database is handled by the testing code, doing away with the template DB in favor of just deleting the data, among other changes. Closes #167

@TheTedder TheTedder changed the title Database Rewrite Database Setup Rewrite Oct 12, 2023
@Dalet
Copy link
Contributor

Dalet commented Oct 12, 2023

I understand the switch to Npgsql Datasource, but what do the rest of the changes achieve? I'd rather see the other changes in a different PR if they're not necessary for the switch.

About the Datasource switch:

  • Please try to keep using the DbContext and Datasource from the Program file instead of replacing them in the tests. Otherwise it leaves the actual Program's DB setup untested. Is it possible to still only change the configuration in the WebApplicationFactory ?

About the other changes:

  • Respawn is an objectively inferior solution, it is slower (a simple in-memory file copy VS Respawn's multiple SQL requests). Does the current solution break with Datasource?
    To be fully honest, I'd rather do away with DB resets entirely and force tests to be written without them; because that leads to higher quality tests (it also runs way faster).
  • Using async methods instead of sync methods has no advantage in this context

@TheTedder TheTedder marked this pull request as ready for review October 14, 2023 01:40
@TheTedder TheTedder requested a review from a team as a code owner October 14, 2023 01:40
@zysim
Copy link
Collaborator

zysim commented Jul 3, 2024

We still using this PR? We tweaking anything from it, if so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task: Use Npgsql Datasource for Type Mapping
3 participants